package srzy.module

import srzy.common.ShellExecute
import srzy.rb._
import srzy.socket.MsgActor

object MsgDeal extends AbsCaseDeal with srzy.common.Logging {

  def deal = {
    val l = getCaseInfo.sendMsg
    //    l.foreach(x => log.debug("sendMsg:" + x))
    getCaseInfo.receMsg = l.map(send => {
      logger.debug("sendMsg:" + send)
      val rece = (MsgActor !! send).apply.toString
      logger.debug("receMsg:" + rece)
      val sessionIdRece = srzy.rb.getSessionId(rece)
      logger.debug("sessionIdRece:" + sessionIdRece)

      val sessionIdSend = srzy.rb.getSessionId(rece)
      logger.debug("sessionIdSend:" + sessionIdSend)

      if (sessionIdSend == sessionIdRece) {
        val a1 = rece.substring(rece.indexOf("[000="))
        a1
      } else {
        logger.error("rece msg session not match!")
        ""
      }
    })
    //    getCaseInfo.receMsg.foreach(s => log.debug("receMsg:" + s))

  }
}